<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>05.v-show设置元素的显示或隐藏</title>
	</head>

	<body>
		<div id="app">

			<input type="button" value="显示隐藏" v-on:click="q2">
			<h1 v-show="food">{{food}}</h1>
		</div>
		<script src="./vue-v2.7.13.js"></script>

		<script>
			//v-show设置元素的显示或隐藏
			//原理是操控display
			var app = new Vue({
				el: "#app", //Id #id class .name  标签 div
				//输出的数据
				data: {
					food: true,
				},
				//对象 方法
				methods: {
					q2: function() {
						this.food = !this.food
						console.log(this.food)
					},
					
				}
			})
		</script>

	</body>

</html>
